package com.hdj.shuzu;

import java.util.Arrays;

/**
 * @Author: HeDongJia
 * @Description:
 * @Date: Create in 22:22 2021/7/19
 * @Modified By:
 */
public class Array遍历 {

    private void array遍历01(){
        String[] arrs={"1","2","3"};
        Arrays.stream(arrs).forEach(System.out::println);
    }

    public void array遍历02(){
        int[] arrs={1,2,3,4,5,6,7,8};
        //数组名.length ---返回数组长度值
        System.out.println(arrs.length);
        for (int i = 0; i < arrs.length; i++) {
            System.out.println(arrs[i]);
        }
    }

    public void array遍历03(){
        int[] arrs={1,2,3,4,5,6,7,8};
        //数组名.length ---返回数组长度值
        for (int i:arrs) {
            System.out.println(i);
        }
    }


    public static void main(String[] args) {
       Array遍历 array遍历=new Array遍历();
       array遍历.array遍历03();
    }
}
